<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //  复杂数据类型传参
        function Hero(name){
            this.name=name;
        }

        function change(x){
            console.log(x.name);
            x.name='貂蝉';
            console.log(x.name);
        }
        var yuji =new Hero('虞姬');
        console.log(yuji.name);
        change(yuji);
        console.log(yuji.name);
    </script>
</body>
</html>